<%--
  Created by IntelliJ IDEA.
  User: shisjin
  Date: 2023/10/9
  Time: 15:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
     request.setAttribute("info","request的值");
     application.setAttribute("info","application的值");
    session.setAttribute("info","session的值~~~~~~");
     //利用pageConext取值
     out.print(pageContext.getRequest().getAttribute("info"));
     out.print("<br>");
     out.print(pageContext.getSession().getAttribute("info"));
    out.print("<br>");
     out.print(pageContext.getServletContext().getAttribute("info"));

     out.print("<br>");
    out.print("<br>");
    out.print("通过scope获取对象");
    out.print("<br>");
    out.print(pageContext.getAttribute("info",1));
    out.print("<br>");
    out.print(pageContext.getAttribute("info",2));
    out.print("<br>");
    out.print(pageContext.getAttribute("info",3));
    out.print("<br>");
    out.print(pageContext.getAttribute("info",4));
 %>

</body>
</html>
